Optimal. Leaf size=58 \[ \frac {(A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )}+\frac {x (a A+b B)}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3531, 3530} \[ \frac {(A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{d \left (a^2+b^2\right )}+\frac {x (a A+b B)}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3530
Rule 3531
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{a+b \tan (c+d x)} \, dx &=\frac {(a A+b B) x}{a^2+b^2}+\frac {(A b-a B) \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^2+b^2}\\ &=\frac {(a A+b B) x}{a^2+b^2}+\frac {(A b-a B) \log (a \cos (c+d x)+b \sin (c+d x))}{\left (a^2+b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 66, normalized size = 1.14 \[ \frac {2 (a A+b B) \tan ^{-1}(\tan (c+d x))-(A b-a B) \left (\log \left (\sec ^2(c+d x)\right )-2 \log (a+b \tan (c+d x))\right )}{2 d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 76, normalized size = 1.31 \[ \frac {2 \, {\left (A a + B b\right )} d x - {\left (B a - A b\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, {\left (a^{2} + b^{2}\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 94, normalized size = 1.62 \[ \frac {\frac {2 \, {\left (A a + B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {{\left (B a - A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, {\left (B a b - A b^{2}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b + b^{3}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.25, size = 153, normalized size = 2.64 \[ \frac {\ln \left (a +b \tan \left (d x +c \right )\right ) A b}{d \left (a^{2}+b^{2}\right )}-\frac {\ln \left (a +b \tan \left (d x +c \right )\right ) a B}{d \left (a^{2}+b^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A b}{2 d \left (a^{2}+b^{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a B}{2 d \left (a^{2}+b^{2}\right )}+\frac {A \arctan \left (\tan \left (d x +c \right )\right ) a}{d \left (a^{2}+b^{2}\right )}+\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d \left (a^{2}+b^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.49, size = 88, normalized size = 1.52 \[ \frac {\frac {2 \, {\left (A a + B b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} - \frac {2 \, {\left (B a - A b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} + b^{2}} + \frac {{\left (B a - A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.67, size = 93, normalized size = 1.60 \[ \frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (A\,b-B\,a\right )}{d\,\left (a^2+b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-B+A\,1{}\mathrm {i}\right )}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.95, size = 524, normalized size = 9.03 \[ \begin {cases} \frac {\tilde {\infty } x \left (A + B \tan {\relax (c )}\right )}{\tan {\relax (c )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {i A d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {A d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {i A}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} - \frac {i B d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} - \frac {B}{2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = - i b \\- \frac {i A d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {A d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {i A}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {i B d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {B}{2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = i b \\\frac {x \left (A + B \tan {\relax (c )}\right )}{a + b \tan {\relax (c )}} & \text {for}\: d = 0 \\\frac {A x + \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {2 A a d x}{2 a^{2} d + 2 b^{2} d} + \frac {2 A b \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} d + 2 b^{2} d} - \frac {A b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} d + 2 b^{2} d} - \frac {2 B a \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {B a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} d + 2 b^{2} d} + \frac {2 B b d x}{2 a^{2} d + 2 b^{2} d} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________